import time
import threading#导入线程模块
def singing():
    for i in range(5):
        print("La la la...",i)
        time.sleep(0.5)
def dancing():
    for i in range(5):
        print("Dancing...",i)
        time.sleep(0.5)
if __name__ == "__main__":
    t1=threading.Thread(target=singing)#将任务交给线程
    t2=threading.Thread(target=dancing)
    t1.start()
    t2.start()